<template>
   <div class="newsinfo-container">
       <h3 class="title">{{newsinfo.title}}</h3>
       <p class="subtitle"> 
           <span>
               发表时间:{{newsinfo.add_time}}
           </span>
           <span>
               点击:{{newsinfo.click}}次
           </span>
       </p>

       <hr>

       <div class="content" v-html="newsinfo.content"></div>
 
       <!-- //评论区域 -->
       <comment-box :id=this.id></comment-box>
   </div>
</template>
<script>
import comment from '../subcomponents/comment.vue'
    export default{
        data(){
            return{
                id:this.$route.params.id,
                newsinfo:{
                    title:"世界大冒险",
                    add_time: new Date(),
                    click:999,
                    content:"<div style='font-size=13'>这是测试数据，<h3>标题测试</h3>"+
                    "</div>的都是多所所所所；所所所所付的舒服舒服发多少所所所所所所所所所所；发的第三方防守打法；连锁，的；"+
                    "了大概多少，老股民了；对面疯了；省得麻烦；老师们顺风车上的光芒；麦当劳；方面把V领；代码发布了没发现率码率没收到吗；"+
                    "了第三名V领啥都没离开是房门上看见你发的教科书<br><img src='https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1545049258361&di=f15f57e165b92989fab5f9dc83a975af&imgtype=0&src=http%3A%2F%2Fpic.makepolo.net%2Fnews%2Fallimg%2F20170105%2F1483575612117570.jpg'>"
                }
            }
        },
        components:{
            "comment-box":comment
        },
        methods:{
            getNewsInfoList(){
                this.$http.get("api/getnew"+id,function(res){
                    if(res.body.status === 0){

                    }else{
                        Toast("获取失败");
                    }
                })
            }
        }
    }
</script>
<style lang="scss">
  .newsinfo-container{
      padding: 0 4px;
      .title{
          font-size: 16px;
          text-align: center;
          margin: 15px 0;
          color: red;
      }
      .subtitle{
          font-size: 13px;
          color: #226aff;
          display: flex;
          justify-content: space-between;
      }
      hr{
        border-top: 1px solid #384c07;
      }
      .content{
        img {
          width: 100%;
        }
      }
  }
</style>
